package com.shop.shopmall.pojo;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.Date;

/**
 * 
 * @TableName goods_info
 */
@TableName(value ="goods_info")
@Data
public class GoodsInfo {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 商品名称
     */
    private String goodsName;

    /**
     * 商品分类
     */
    private String classify;

    /**
     * 单位
     */
    private String unit;

    /**
     * 商品简介
     */
    private String descText;

    /**
     * 商品封面图
     */
    private String titleImage;

    /**
     * 商品轮播图
     */
    private String bannerImage;

    /**
     * 商品规格 1-单规格 2-多规格
     */
    private String skuType;

    /**
     * 佣金设置
     */
    private Integer isRaio;

    /**
     * 商品详情
     */
    private String goodsDetail;

    /**
     * 排序
     */
    private Integer sort;

    /**
     * 积分
     */
    private String points;

    /**
     * 销量
     */
    private String number;

    /**
     * 商品推荐，1-热卖 2-榜单  数据格式： 1,2
     */
    private String recommend;

    /**
     * 活动优先级
     */
    private String activity;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 修改时间
     */
    private Date updateTime;

    /**
     * 状态
     */
    private String status;

    /**
     * 是否加入回收站
     */
    private String isRecycle;

    @TableField(exist = false)
    private int pageNum;

    @TableField(exist = false)
    private int pageSize;

    @TableField(exist = false)
    private String tabs;

    @TableField(exist = false)
    private Integer[] classifyIds;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        GoodsInfo other = (GoodsInfo) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getGoodsName() == null ? other.getGoodsName() == null : this.getGoodsName().equals(other.getGoodsName()))
            && (this.getClassify() == null ? other.getClassify() == null : this.getClassify().equals(other.getClassify()))
            && (this.getUnit() == null ? other.getUnit() == null : this.getUnit().equals(other.getUnit()))
            && (this.getDescText() == null ? other.getDescText() == null : this.getDescText().equals(other.getDescText()))
            && (this.getTitleImage() == null ? other.getTitleImage() == null : this.getTitleImage().equals(other.getTitleImage()))
            && (this.getBannerImage() == null ? other.getBannerImage() == null : this.getBannerImage().equals(other.getBannerImage()))
            && (this.getSkuType() == null ? other.getSkuType() == null : this.getSkuType().equals(other.getSkuType()))
            && (this.getIsRaio() == null ? other.getIsRaio() == null : this.getIsRaio().equals(other.getIsRaio()))
            && (this.getGoodsDetail() == null ? other.getGoodsDetail() == null : this.getGoodsDetail().equals(other.getGoodsDetail()))
            && (this.getSort() == null ? other.getSort() == null : this.getSort().equals(other.getSort()))
            && (this.getPoints() == null ? other.getPoints() == null : this.getPoints().equals(other.getPoints()))
            && (this.getNumber() == null ? other.getNumber() == null : this.getNumber().equals(other.getNumber()))
            && (this.getRecommend() == null ? other.getRecommend() == null : this.getRecommend().equals(other.getRecommend()))
            && (this.getActivity() == null ? other.getActivity() == null : this.getActivity().equals(other.getActivity()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getIsRecycle() == null ? other.getIsRecycle() == null : this.getIsRecycle().equals(other.getIsRecycle()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getGoodsName() == null) ? 0 : getGoodsName().hashCode());
        result = prime * result + ((getClassify() == null) ? 0 : getClassify().hashCode());
        result = prime * result + ((getUnit() == null) ? 0 : getUnit().hashCode());
        result = prime * result + ((getDescText() == null) ? 0 : getDescText().hashCode());
        result = prime * result + ((getTitleImage() == null) ? 0 : getTitleImage().hashCode());
        result = prime * result + ((getBannerImage() == null) ? 0 : getBannerImage().hashCode());
        result = prime * result + ((getSkuType() == null) ? 0 : getSkuType().hashCode());
        result = prime * result + ((getIsRaio() == null) ? 0 : getIsRaio().hashCode());
        result = prime * result + ((getGoodsDetail() == null) ? 0 : getGoodsDetail().hashCode());
        result = prime * result + ((getSort() == null) ? 0 : getSort().hashCode());
        result = prime * result + ((getPoints() == null) ? 0 : getPoints().hashCode());
        result = prime * result + ((getNumber() == null) ? 0 : getNumber().hashCode());
        result = prime * result + ((getRecommend() == null) ? 0 : getRecommend().hashCode());
        result = prime * result + ((getActivity() == null) ? 0 : getActivity().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getIsRecycle() == null) ? 0 : getIsRecycle().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", goodsName=").append(goodsName);
        sb.append(", classify=").append(classify);
        sb.append(", unit=").append(unit);
        sb.append(", descText=").append(descText);
        sb.append(", titleImage=").append(titleImage);
        sb.append(", bannerImage=").append(bannerImage);
        sb.append(", skuType=").append(skuType);
        sb.append(", isRaio=").append(isRaio);
        sb.append(", goodsDetail=").append(goodsDetail);
        sb.append(", sort=").append(sort);
        sb.append(", points=").append(points);
        sb.append(", number=").append(number);
        sb.append(", recommend=").append(recommend);
        sb.append(", activity=").append(activity);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", status=").append(status);
        sb.append(", isRecycle=").append(isRecycle);
        sb.append("]");
        return sb.toString();
    }
}